package com.yxinsur.imc.business.enums;

import com.yxinsur.imc.common.utils.StringUtils;
import lombok.Getter;

/**
 * 计算规则 退保/减额交清/新增附加险/复效/已缴费豁免/未缴费豁免
 */
@Getter
public enum PersistencyRuleEnum {

    A("A","退保"),
    B("B","减额交清"),
    C("C","新增附加险"),
    D("D","复效"),
    E("E","已缴费豁免"),
    F("F","未缴费豁免");


    private String code;
    private String value;

    private PersistencyRuleEnum(String code,String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(String code){
        String keyValue = null;
        if(StringUtils.isNotBlank(code)){
            for (PersistencyRuleEnum c : PersistencyRuleEnum.values()) {
                if (c.getCode().equals(code)) {
                    keyValue = c.value;
                }
            }
        }
        return keyValue;
    }

}
